package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.come.bean.ConfigureBean;
import org.come.model.Configure;
import org.come.until.CutButtonImage;
import org.come.until.UserMessUntil;

import com.tool.btn.FormsOnOffBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;



public class EventCalendarJpanel extends JPanel {
    private JLabel labtext1, labtext2,//
            labtext4, labtext5, labtext6;//
    public JLabel labtext7, labtext8, labtext9;
    private Integer maxDay = getCurrentMonthDay();
    private int day = 0;
    private Set<Integer> days = new HashSet<>();
    private Set<Integer> lqs = new HashSet<>();
    private int[] s = new int[]{70, 169, 265, 361, 457};
    private int[] sy = new int[]{3, 7, 15, 20, 28};
    private String[] str1 = {"周一", "周二", "周三", "周四", "周五", "周六", "周日"};

    private Map<String, String> map = new HashMap<>();

    private String[] task1 = {};
    private String[] task2 = {};
    private Map<String, Object> taskMap = new HashMap<String, Object>();

    public EventCalendarJpanel() {

        ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
        Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
        Configure configure1 = item.get(new BigDecimal(2));//活动一
        Configure configure2 = item.get(new BigDecimal(3));//活动二
        Configure configure3 = item.get(new BigDecimal(4));//活动三 自定义活动
        if (configure1.getZqsld() != null) {
            task1 = configure1.getZqsld().split(",");
        }
        if (configure2.getZqsld() != null) {
            task2 = configure2.getZqsld().split(",");
        }
        if (configure3.getZqsld() != null) {
            String[] task3 = configure3.getZqsld().split(",");
            for (String s : task3) {
                String[] stak = s.split("\\|");
                taskMap.put(stak[0], stak[1]);
            }
        }

        if ("水墨UI".equals(MyIsif.getStyle())) {


            this.setPreferredSize(new Dimension(595, 532));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);
            // 关闭按钮事件
//            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 1104);
//            offBtn.setBounds(522 - 25, 0, 25, 25);
//            this.add(offBtn);
            Font font = new Font("宋体", Font.PLAIN, 14);
            //huodong
            labtext2 = new JLabel();
            labtext2.setForeground(Color.BLACK);
            labtext2.setFont(font);
            this.add(labtext2);
            labtext1 = new JLabel();
            labtext1.setForeground(Color.BLACK);
            labtext1.setFont(font);
            this.add(labtext1);

            labtext6 = new JLabel();
            labtext6.setForeground(Color.green);
            labtext6.setFont(font);
            this.add(labtext6);
            font = new Font("宋体", Font.PLAIN, 14);
            this.labtext7 = new JLabel();
            this.labtext7.setBounds(55, 385, 460, 36);
            this.labtext7.setForeground(Color.green);
            this.labtext7.setFont(font);
            this.add(this.labtext7);
            this.labtext8 = new JLabel();
            this.labtext8.setBounds(55, 405, 460, 36);
            this.labtext8.setForeground(Color.green);
            this.labtext8.setFont(font);
            this.add(this.labtext8);
            this.labtext9 = new JLabel();
            this.labtext9.setBounds(55, 425, 460, 36);
            this.labtext9.setForeground(Color.green);
            this.labtext9.setFont(font);
            this.add(this.labtext9);

            for (int x = 0; x < 7; x++) {
                labtext4 = new JLabel();
                this.labtext4.setBounds(35 + 59 + x * 66, 123, 66, 51);
                this.labtext4.setText(str1[x] + "");
                this.add(labtext4);
            }


            Calendar now = Calendar.getInstance();
            int year = now.get(Calendar.YEAR);
            int month = now.get(Calendar.MONTH) + 1;

            font = new Font("小篆", Font.BOLD, 24);
            labtext5 = new JLabel();
            labtext5.setFont(UIUtils.TEXT_FONTZSRL);
            labtext5.setBounds(188 + 59, 2 + 75, 350, 50);
            labtext5.setText(year + "年" + month + "月");
            this.add(labtext5);

            font = new Font("楷体", Font.BOLD, 20);
            day = now.get(Calendar.DAY_OF_MONTH);
            //月份要减一，在西方周日是一周的第1天（日期也需要减一）
            now.set(year, month - 1, 1 - 1);
            int x = now.get(Calendar.DAY_OF_WEEK) - 2;
            int y = 0;
            int dd = now.get(Calendar.DAY_OF_WEEK) - 1;
            int j = 0;
            int ls = 0;
            for (int i = 1; i <= 7 - dd; i++) {
                ls = i;
                JLabel temp = new JLabel();
                x++;
                if (x < 7) {
                    temp.setForeground(UIUtils.COLOR_YMRCode);
                    temp.setFont(font);
                    temp.setBounds(20 + 59 + x * 66, 81 + y * 52, 465, 180);
                    temp.setText(i + "");
                    getstak(i, x, y);
                } else {
                    temp.setForeground(Color.black);
                    temp.setFont(font);
                    temp.setBounds(20 + 59 + x * 66, 81 + y * 52, 465, 180);
                    temp.setText(i + "");
                    getstak(i, x, y);
                }
                ls = i;
                this.add(temp);
            }
            x = 0;
            y = 0;
            int sq = 0;
            for (int i = ls + 1; i <= maxDay; i++) {
                JLabel temp = new JLabel();
                if (sq % 7 == 0) {
                    x = 0;
                    y++;
                }
                if (y == 0) {
                } else {
                    if (x > 1) {
                        temp.setForeground(UIUtils.COLOR_YMRCode);
                        temp.setFont(font);
                        temp.setBounds(20 + 59 + x * 66, 81 + y * 52, 465, 180);
                        temp.setText(i + "");
                        getstak(i, x, y);
                    } else {
                        temp.setForeground(Color.BLACK);
                        temp.setFont(font);
                        temp.setBounds(20 + 59 + x * 66, 81 + y * 52, 465, 180);
                        temp.setText(i + "");
                        getstak(i, x, y);
                    }
                }
                this.add(temp);
                sq++;
                x++;
            }
        } else {


            this.setPreferredSize(new Dimension(569, 501));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);
            // 关闭按钮事件
//            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 1104);
//            offBtn.setBounds(522 - 25, 0, 25, 25);
//            this.add(offBtn);
            Font font = new Font("宋体", Font.PLAIN, 14);
            //huodong
            labtext2 = new JLabel();
            labtext2.setForeground(Color.BLACK);
            labtext2.setFont(font);
            this.add(labtext2);
            labtext1 = new JLabel();
            labtext1.setForeground(Color.BLACK);
            labtext1.setFont(font);
            this.add(labtext1);

            labtext6 = new JLabel();
            labtext6.setForeground(Color.green);
            labtext6.setFont(font);
            this.add(labtext6);
            font = new Font("宋体", Font.PLAIN, 14);
            this.labtext7 = new JLabel();
            this.labtext7.setBounds(55, 385, 460, 36);
            this.labtext7.setForeground(Color.green);
            this.labtext7.setFont(font);
            this.add(this.labtext7);
            this.labtext8 = new JLabel();
            this.labtext8.setBounds(55, 405, 460, 36);
            this.labtext8.setForeground(Color.green);
            this.labtext8.setFont(font);
            this.add(this.labtext8);
            this.labtext9 = new JLabel();
            this.labtext9.setBounds(55, 425, 460, 36);
            this.labtext9.setForeground(Color.green);
            this.labtext9.setFont(font);
            this.add(this.labtext9);

            for (int x = 0; x < 7; x++) {
                labtext4 = new JLabel();
                this.labtext4.setBounds(35 + 37 + x * 66, 123, 66, 51);
                this.labtext4.setText(str1[x] + "");
                this.add(labtext4);
            }


            Calendar now = Calendar.getInstance();
            int year = now.get(Calendar.YEAR);
            int month = now.get(Calendar.MONTH) + 1;

            font = new Font("小篆", Font.BOLD, 24);
            labtext5 = new JLabel();
            labtext5.setFont(UIUtils.TEXT_FONTZSRL);
            labtext5.setBounds(188 + 37, 2 + 75, 350, 50);
            labtext5.setText(year + "年" + month + "月");
            this.add(labtext5);

            font = new Font("楷体", Font.BOLD, 20);
            day = now.get(Calendar.DAY_OF_MONTH);
            //月份要减一，在西方周日是一周的第1天（日期也需要减一）
            now.set(year, month - 1, 1 - 1);
            int x = now.get(Calendar.DAY_OF_WEEK) - 2;
            int y = 0;
            int dd = now.get(Calendar.DAY_OF_WEEK) - 1;
            int j = 0;
            int ls = 0;
            for (int i = 1; i <= 7 - dd; i++) {
                ls = i;
                JLabel temp = new JLabel();
                x++;
                if (x < 7) {
                    temp.setForeground(UIUtils.COLOR_YMRCode);
                    temp.setFont(font);
                    temp.setBounds(20 + 37 + x * 66, 81 + y * 52, 465, 180);
                    temp.setText(i + "");
                    getstak(i, x, y);
                } else {
                    temp.setForeground(Color.black);
                    temp.setFont(font);
                    temp.setBounds(20 + 37 + x * 66, 81 + y * 52, 465, 180);
                    temp.setText(i + "");
                    getstak(i, x, y);
                }
                ls = i;
                this.add(temp);
            }
            x = 0;
            y = 0;
            int sq = 0;
            for (int i = ls + 1; i <= maxDay; i++) {
                JLabel temp = new JLabel();
                if (sq % 7 == 0) {
                    x = 0;
                    y++;
                }
                if (y == 0) {
                } else {
                    if (x > 1) {
                        temp.setForeground(UIUtils.COLOR_YMRCode);
                        temp.setFont(font);
                        temp.setBounds(20 + 37 + x * 66, 81 + y * 52, 465, 180);
                        temp.setText(i + "");
                        getstak(i, x, y);
                    } else {
                        temp.setForeground(Color.BLACK);
                        temp.setFont(font);
                        temp.setBounds(20 + 37 + x * 66, 81 + y * 52, 465, 180);
                        temp.setText(i + "");
                        getstak(i, x, y);
                    }
                }
                this.add(temp);
                sq++;
                x++;
            }
        }

    }

    //    private ImageIcon icon = CutButtonImage.getImage(imageMap.getImgMap().get("B204h"),"B204h", 569, 501);
//    private ImageIcon icon1 = CutButtonImage.getImage("inkImg/old/background/日历底图1.png", 474, 319);
    private ImageIcon icon3 = CutButtonImage.getImage("inkImg/old/background/格子.png", 66, 52);
    private ImageIcon today = new ImageIcon("inkImg/old/background/今日框.png");
    private ImageIcon week = CutButtonImage.getImage("inkImg/old/background/week.png", 66, 26);
    private ImageIcon icon2 = CutButtonImage.getImage("inkImg/old/background/边框底图.png", 469, 336);
    private ImageIcon icon4 = CutButtonImage.getImage("inkImg/old/background/年月.png", 188, 35);
    private ImageIcon icon5 = CutButtonImage.getImage("inkImg/old/background/左.png", 33, 35);
    private ImageIcon icon6 = CutButtonImage.getImage("inkImg/old/background/右.png", 33, 35);

    public static int getCurrentMonthDay() {
        Calendar a = Calendar.getInstance();

        a.set(Calendar.DATE, 1);

        a.roll(Calendar.DATE, -1);

        int maxDate = a.get(Calendar.DATE);

        return maxDate;

    }

    private ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        // TODO Auto-generated method stub
        super.paintComponent(g);
        if ("水墨UI".equals(MyIsif.getStyle())) {


            icon = CutButtonImage.getImage("inkImg/newbackground/B204.png", 595, 532);
            Calendar now = Calendar.getInstance();
            int year = now.get(Calendar.YEAR);
            int month = now.get(Calendar.MONTH) + 1;
            day = now.get(Calendar.DAY_OF_MONTH);
            now.set(year, month - 1, 1 - 1);
            int dd = now.get(Calendar.DAY_OF_WEEK) - 1;
            g.drawImage(icon.getImage(), 0, 0, 595, 532, this);
//        	g.drawImage(icon1.getImage(), 40, 50, 454, 349, this);
            g.drawImage(icon2.getImage(), 13 + 59, 127, 469, 336, this);
            g.drawImage(icon4.getImage(), 135 + 3 + 59, 18 + 65, 188, 35, this);
            g.drawImage(icon5.getImage(), 135 + 59, 18 + 65, 33, 35, this);
            g.drawImage(icon6.getImage(), 135 + 59 + 188 + 2, 18 + 65, 33, 35, this);

            for (int x = 0; x < 7; x++) {
                g.drawImage(week.getImage(), 17 + 59 + x * 66, 135, 66, 26, this);
            }
            int x = dd;
            int y = 0;

            g.drawImage(icon3.getImage(), 17 + 59, 160, 66, 52, this);
            for (int i = 1; i <= maxDay + 1; i++) {
                x++;
                if (i % 7 == 0) {
                    x = 0;
                    y++;
                }
                if (y == 0) {
                    if (x < 7) {
                        g.drawImage(icon3.getImage(), 17 + 59 + x * 66, 160 + y * 52, 66, 51, this);
                    }
                } else {
                    g.drawImage(icon3.getImage(), 17 + 59 + x * 66, 160 + y * 52, 66, 51, this);
                }
                if (day == i - 1) {
                    g.drawImage(today.getImage(), 17 + 59 + x * 66, 160 + y * 52, 66, 51, this);
                }
            }
            g.drawImage(icon3.getImage(), 17 + 59 + 1 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 59 + 2 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 59 + 3 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 59 + 4 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 59 + 5 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 59 + 6 * 66, 160 + 4 * 52, 66, 52, this);
        } else {
            icon = CutButtonImage.getImage("inkImg/hongmu/B204h.png", 569, 501);
            Calendar now = Calendar.getInstance();
            int year = now.get(Calendar.YEAR);
            int month = now.get(Calendar.MONTH) + 1;
            day = now.get(Calendar.DAY_OF_MONTH);
            now.set(year, month - 1, 1 - 1);
            int dd = now.get(Calendar.DAY_OF_WEEK) - 1;
            g.drawImage(icon.getImage(), 0, 0, 569, 501, this);
//        	g.drawImage(icon1.getImage(), 40, 50, 454, 349, this);
            g.drawImage(icon2.getImage(), 13 + 37, 127, 469, 336, this);
            g.drawImage(icon4.getImage(), 135 + 3 + 37, 18 + 65, 188, 35, this);
            g.drawImage(icon5.getImage(), 135 + 37, 18 + 65, 33, 35, this);
            g.drawImage(icon6.getImage(), 135 + 37 + 188 + 2, 18 + 65, 33, 35, this);

            for (int x = 0; x < 7; x++) {
                g.drawImage(week.getImage(), 17 + 37 + x * 66, 135, 66, 26, this);
            }
            int x = dd;
            int y = 0;

            g.drawImage(icon3.getImage(), 17 + 37, 160, 66, 52, this);
            for (int i = 1; i <= maxDay + 1; i++) {
                x++;
                if (i % 7 == 0) {
                    x = 0;
                    y++;
                }
                if (y == 0) {
                    if (x < 7) {
                        g.drawImage(icon3.getImage(), 17 + 37 + x * 66, 160 + y * 52, 66, 51, this);
                    }
                } else {
                    g.drawImage(icon3.getImage(), 17 + 37 + x * 66, 160 + y * 52, 66, 51, this);
                }
                if (day == i - 1) {
                    g.drawImage(today.getImage(), 17 + 37 + x * 66, 160 + y * 52, 66, 51, this);
                }
            }
            g.drawImage(icon3.getImage(), 17 + 37 + 1 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 37 + 2 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 37 + 3 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 37 + 4 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 37 + 5 * 66, 160 + 4 * 52, 66, 52, this);
            g.drawImage(icon3.getImage(), 17 + 37 + 6 * 66, 160 + 4 * 52, 66, 52, this);
        }
    }

    public void getstak(int i, int x, int y) {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            Calendar now1 = Calendar.getInstance();
            int year1 = now1.get(Calendar.YEAR);
            int month1 = now1.get(Calendar.MONTH) + 1;
            now1.set(year1, month1 - 1, i - 1);//设置当前时间,月份是从0月开始计算
            int tayweek = now1.get(Calendar.DAY_OF_WEEK);//星期表示1-7，是从星期日开始，
            Font font = new Font("宋体", 0, 11);
            labtext1.setFont(font);
            labtext2.setFont(font);
            labtext6.setForeground(UIUtils.COLOR_YMRCode);
            labtext6.setFont(font);

            map.put(i + "", (17 + 59 + x * 66) + "," + (160 + y * 52) + "," + 66 + "," + 52);

            if (taskMap != null) {
                for (String key : taskMap.keySet()) {
                    if (key.equals(i + "")) {
                        if (taskMap.get(i + "") != null) {
                            labtext6 = new JLabel();
                            this.labtext6.setBounds(18 + 59 + x * 66, 100 + 58 + y * 52, 66, 51);
                            this.labtext6.setText(taskMap.get(i + "").toString());
                            map.put(i + "三", taskMap.get(i + "").toString());
                            this.add(labtext6);
                        }
                    }
                }
            }
            map.put(i + "一", task1[tayweek - 1].toString());
            map.put(i + "二", task2[tayweek - 1].toString());

            if (tayweek == 1) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 2) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 3) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 4) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                font = new Font("宋体", 0, 11);
                this.labtext2.setFont(font);
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 5) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 6) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 7) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 59 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 59 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
        } else {

            Calendar now1 = Calendar.getInstance();
            int year1 = now1.get(Calendar.YEAR);
            int month1 = now1.get(Calendar.MONTH) + 1;
            now1.set(year1, month1 - 1, i - 1);//设置当前时间,月份是从0月开始计算
            int tayweek = now1.get(Calendar.DAY_OF_WEEK);//星期表示1-7，是从星期日开始，
            Font font = new Font("宋体", 0, 11);
            labtext1.setFont(font);
            labtext2.setFont(font);
            labtext6.setForeground(UIUtils.COLOR_YMRCode);
            labtext6.setFont(font);

            map.put(i + "", (17 + 37 + x * 66) + "," + (160 + y * 52) + "," + 66 + "," + 52);

            if (taskMap != null) {
                for (String key : taskMap.keySet()) {
                    if (key.equals(i + "")) {
                        if (taskMap.get(i + "") != null) {
                            labtext6 = new JLabel();
                            this.labtext6.setBounds(18 + 37 + x * 66, 100 + 58 + y * 52, 66, 51);
                            this.labtext6.setText(taskMap.get(i + "").toString());
                            map.put(i + "三", taskMap.get(i + "").toString());
                            this.add(labtext6);
                        }
                    }
                }
            }
            map.put(i + "一", task1[tayweek - 1].toString());
            map.put(i + "二", task2[tayweek - 1].toString());

            if (tayweek == 1) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 2) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 3) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 4) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                font = new Font("宋体", 0, 11);
                this.labtext2.setFont(font);
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 5) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 6) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
            if (tayweek == 7) {
                labtext1 = new JLabel();
                this.labtext1.setBounds(18 + 37 + x * 66, 112 + 58 + y * 52, 66, 51);
                if (task1[tayweek - 1].length() > 0) {
                    this.labtext1.setText(task1[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext1);
                labtext2 = new JLabel();
                this.labtext2.setBounds(18 + 37 + x * 66, 107 + 74 + y * 52, 66, 51);
                if (task2[tayweek - 1].length() > 0) {
                    this.labtext2.setText(task2[tayweek - 1].split("\\|")[0]);
                }
                this.add(labtext2);
            }
        }
    }


    public Set<Integer> getDays() {
        return days;
    }

    public void setDays(Set<Integer> days) {
        this.days = days;
    }

    public Set<Integer> getLqs() {
        return lqs;
    }

    public void setLqs(Set<Integer> lqs) {
        this.lqs = lqs;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

}
